/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.swt.mto.thithu.service.persistence;

import com.liferay.portal.service.persistence.BasePersistence;

import com.swt.mto.thithu.model.QuizCategory;

/**
 * The persistence interface for the quiz category service.
 *
 * <p>
 * Caching information and settings can be found in <code>portal.properties</code>
 * </p>
 *
 * @author tuan.nguyen
 * @see QuizCategoryPersistenceImpl
 * @see QuizCategoryUtil
 * @generated
 */
public interface QuizCategoryPersistence extends BasePersistence<QuizCategory> {
	/*
	 * NOTE FOR DEVELOPERS:
	 *
	 * Never modify or reference this interface directly. Always use {@link QuizCategoryUtil} to access the quiz category persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
	 */

	/**
	* Caches the quiz category in the entity cache if it is enabled.
	*
	* @param quizCategory the quiz category
	*/
	public void cacheResult(com.swt.mto.thithu.model.QuizCategory quizCategory);

	/**
	* Caches the quiz categories in the entity cache if it is enabled.
	*
	* @param quizCategories the quiz categories
	*/
	public void cacheResult(
		java.util.List<com.swt.mto.thithu.model.QuizCategory> quizCategories);

	/**
	* Creates a new quiz category with the primary key. Does not add the quiz category to the database.
	*
	* @param quizCategoryId the primary key for the new quiz category
	* @return the new quiz category
	*/
	public com.swt.mto.thithu.model.QuizCategory create(long quizCategoryId);

	/**
	* Removes the quiz category with the primary key from the database. Also notifies the appropriate model listeners.
	*
	* @param quizCategoryId the primary key of the quiz category
	* @return the quiz category that was removed
	* @throws com.swt.mto.thithu.NoSuchQuizCategoryException if a quiz category with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.swt.mto.thithu.model.QuizCategory remove(long quizCategoryId)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.swt.mto.thithu.NoSuchQuizCategoryException;

	public com.swt.mto.thithu.model.QuizCategory updateImpl(
		com.swt.mto.thithu.model.QuizCategory quizCategory, boolean merge)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the quiz category with the primary key or throws a {@link com.swt.mto.thithu.NoSuchQuizCategoryException} if it could not be found.
	*
	* @param quizCategoryId the primary key of the quiz category
	* @return the quiz category
	* @throws com.swt.mto.thithu.NoSuchQuizCategoryException if a quiz category with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.swt.mto.thithu.model.QuizCategory findByPrimaryKey(
		long quizCategoryId)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.swt.mto.thithu.NoSuchQuizCategoryException;

	/**
	* Returns the quiz category with the primary key or returns <code>null</code> if it could not be found.
	*
	* @param quizCategoryId the primary key of the quiz category
	* @return the quiz category, or <code>null</code> if a quiz category with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.swt.mto.thithu.model.QuizCategory fetchByPrimaryKey(
		long quizCategoryId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns all the quiz categories where parentId = &#63;.
	*
	* @param parentId the parent ID
	* @return the matching quiz categories
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.swt.mto.thithu.model.QuizCategory> findByPrId(
		long parentId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns a range of all the quiz categories where parentId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param parentId the parent ID
	* @param start the lower bound of the range of quiz categories
	* @param end the upper bound of the range of quiz categories (not inclusive)
	* @return the range of matching quiz categories
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.swt.mto.thithu.model.QuizCategory> findByPrId(
		long parentId, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns an ordered range of all the quiz categories where parentId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param parentId the parent ID
	* @param start the lower bound of the range of quiz categories
	* @param end the upper bound of the range of quiz categories (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of matching quiz categories
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.swt.mto.thithu.model.QuizCategory> findByPrId(
		long parentId, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the first quiz category in the ordered set where parentId = &#63;.
	*
	* @param parentId the parent ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching quiz category
	* @throws com.swt.mto.thithu.NoSuchQuizCategoryException if a matching quiz category could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.swt.mto.thithu.model.QuizCategory findByPrId_First(
		long parentId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.swt.mto.thithu.NoSuchQuizCategoryException;

	/**
	* Returns the first quiz category in the ordered set where parentId = &#63;.
	*
	* @param parentId the parent ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching quiz category, or <code>null</code> if a matching quiz category could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.swt.mto.thithu.model.QuizCategory fetchByPrId_First(
		long parentId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the last quiz category in the ordered set where parentId = &#63;.
	*
	* @param parentId the parent ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching quiz category
	* @throws com.swt.mto.thithu.NoSuchQuizCategoryException if a matching quiz category could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.swt.mto.thithu.model.QuizCategory findByPrId_Last(
		long parentId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.swt.mto.thithu.NoSuchQuizCategoryException;

	/**
	* Returns the last quiz category in the ordered set where parentId = &#63;.
	*
	* @param parentId the parent ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching quiz category, or <code>null</code> if a matching quiz category could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.swt.mto.thithu.model.QuizCategory fetchByPrId_Last(
		long parentId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the quiz categories before and after the current quiz category in the ordered set where parentId = &#63;.
	*
	* @param quizCategoryId the primary key of the current quiz category
	* @param parentId the parent ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the previous, current, and next quiz category
	* @throws com.swt.mto.thithu.NoSuchQuizCategoryException if a quiz category with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.swt.mto.thithu.model.QuizCategory[] findByPrId_PrevAndNext(
		long quizCategoryId, long parentId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.swt.mto.thithu.NoSuchQuizCategoryException;

	/**
	* Returns all the quiz categories.
	*
	* @return the quiz categories
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.swt.mto.thithu.model.QuizCategory> findAll()
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns a range of all the quiz categories.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of quiz categories
	* @param end the upper bound of the range of quiz categories (not inclusive)
	* @return the range of quiz categories
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.swt.mto.thithu.model.QuizCategory> findAll(
		int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns an ordered range of all the quiz categories.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of quiz categories
	* @param end the upper bound of the range of quiz categories (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of quiz categories
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.swt.mto.thithu.model.QuizCategory> findAll(
		int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Removes all the quiz categories where parentId = &#63; from the database.
	*
	* @param parentId the parent ID
	* @throws SystemException if a system exception occurred
	*/
	public void removeByPrId(long parentId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Removes all the quiz categories from the database.
	*
	* @throws SystemException if a system exception occurred
	*/
	public void removeAll()
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of quiz categories where parentId = &#63;.
	*
	* @param parentId the parent ID
	* @return the number of matching quiz categories
	* @throws SystemException if a system exception occurred
	*/
	public int countByPrId(long parentId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of quiz categories.
	*
	* @return the number of quiz categories
	* @throws SystemException if a system exception occurred
	*/
	public int countAll()
		throws com.liferay.portal.kernel.exception.SystemException;
}